//
//  MHActionSheet.h
//  AFNetworking
//
//  Created by SY on 2019/7/27.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, MHActionStyle) {
    kMHActionStyleDefault = 0,
    //    kMHActionStyleCancel,
    kMHActionStyleDestructive
};


@class MHActionSheetAction;

typedef void (^ACTION_BLOCK)(MHActionSheetAction *action);

@interface MHActionSheetAction  : NSObject

@property (nonatomic, copy) NSString *title;

@property (nonatomic) MHActionStyle style;

@property (nonatomic, copy) ACTION_BLOCK handler;

+ (instancetype)actionWithTitle:(NSString *)title handler:(ACTION_BLOCK)handler;

+ (instancetype)actionWithTitle:(NSString *)title handler:(ACTION_BLOCK)handler style:(MHActionStyle)style;

@end

extern MHActionSheetAction *MH_ActionSheetSeperator;

@interface MHActionSheet : UIView
- (instancetype)initWithTitle:(NSString *)title;

- (void)addAction:(MHActionSheetAction *)action;

- (void)addActions:(NSArray<MHActionSheetAction *> *)actions;

- (void)showInWindow:(UIWindow *)window;

- (void)hideInWindow:(UIWindow *)window;
@end

